﻿<?php

/*
 * action : Login
 * param: user、password
 * return: uid、sex、money、rmb、coin、login_days、is_get、history[2] (total_win、total_lose)、total_borad、total_win、exp
 */
header("Content-type:text/html;charset=utf-8");
?>
<form action="" method="post">
用户名：<input type="text" name='user'/></br>
密&nbsp;&nbsp;码：<input type="text" name="password"/></br>
<input type="submit" />

</form>
<?php	
error_reporting(0);
include_once("httpclient.php");
include_once('config.php');
$url_prefix = Config::$url_prefix;

$action = "Login";

$param = array();
$param['user'] = $_POST['user'];
$param['password'] = $_POST['password'];
$puid['puid'] = "davetest";

$query = array();
$query['action'] = $action;
$query['ver'] = Config::$ver;
$query['param'] = json_encode($param);

$url = $url_prefix . http_build_query($query);
//echo $url;

//http://127.0.0.1/zjhapi/api.php?action=Login&ver=1.5.1&param=%7B%22user%22%3A%22koqi81812%22%2C%22password%22%3A%22312375%22%7D
//http://127.0.0.1/zjhapi/api.php?action=Login&ver=1.5.1&param={%22user%22%3A%22koqi81812%22%2C%22password%22%3A%22312375%22}

//http://127.0.0.1/zjhapi/api.php?action=Login&ver=1.5.1&param={%22user%22%3A%22koqi81812%22%2C%22password%22%3A%22312375%22}
$client = new HttpClient();
echo "<pre />";
echo $client->get($url);

?>
